package com.qust.edu.aliyun.controller;

import com.qust.edu.aliyun.dto.OrdersDto;
import com.qust.edu.aliyun.service.OrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * projectName: ALIYUN
 *
 * @author: 姜龙
 * time: 2021/9/28 13:59
 * description:
 */
@RestController
@CrossOrigin("*")
@RequestMapping("order")
public class OrdersController {

    @Autowired
    private OrdersService orderService;


    /**
     * 按订单交易状态查询
     * @param ordersDto
     * @return
     */
    @PostMapping("getOrderStatus")
    public Object getOrderStatus(@RequestBody OrdersDto ordersDto){

        System.out.println("ordersDto = " + ordersDto);
        Object r = orderService.getOrderStatus(ordersDto);

        return r;
    }


    /**
     * 查询订单商品买家信息
     * @param ordersDto
     * @return
     */
    @PostMapping("getOrderBuyer")
    public Object  getOrderBuyer(@RequestBody OrdersDto ordersDto){

        Object r = orderService.getOrderBuyer(ordersDto);

        return r;
    }



}
